import { makeAutoObservable } from "mobx";
import * as ArticlesApi from "../api/articles";
class Store{
    
    constructor() {
        makeAutoObservable(this);
    }
    Articles = [];
    // 获取频道列表
    getChannels=[];
    //发布文章
    publishArticle=[];


    *updateChannels() {
        const res = yield ArticlesApi.getArticleDetailId();
        this.getChannels = res;
    }


    *updateArticles(params) {
        // 发请求
        const res = yield ArticlesApi.getArticles(params);
        this.Articles = res;
    }
    //修改文章
    // *updateArticles(articleId) {
    //     // 发请求
    //     const res = yield ArticlesApi.editArticles(articleId);
    //     console.log(res);
    //     this.publishArticle = res;
    // }
}
export default new Store();
